package com.dcyao.musicserve.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dcyao.musicserve.domain.Collect;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author admin
* @description 针对表【collect(收集表)】的数据库操作Mapper
* @Entity com.xs.domain.Collect
*/
@Mapper
public interface CollectMapper extends BaseMapper<Collect> {
    /**
     * 查询某个用户是否已经收藏某个乐谱
     * @param staffId
     * @return
     */
    @Select("SELECT COUNT(*) from collect where consumer_id=#{consumerId} and staff_id=#{staffId}")
    int existConsumer(@Param("consumerId") Integer consumerId, @Param("staffId") Integer staffId);


}
